package sceneInfo;


/** This class holds visual information about goal
 * 
 */

public class GoalInfo extends ObjectInfo
{

	private static final long serialVersionUID = 1L;

	//what side the goal is on left, right, or unknown
  	private char m_side;

  	
  	public GoalInfo()
  	{
  		super("goal");
  		m_side = ' ';
  	}

  	public GoalInfo(char side)
  	{
  		super("goal " + side);
  		testSide(side);
  		m_side = side;
  	}

    public String toString(){
		return "["+ m_side+ " Goal at "+getDistance()+"m in dir:"+getDirection()+"]";
	}
  	
  	public char getSide()
  	{
  		return m_side;
  	}
  
  	public void setSide(char s){
  		testSide(s);
  		m_side = s;
  	}
  	
  	private void testSide(char side){
  		if (side != ' ' && side != 'l' && side != 'r'){
  			throw new IllegalArgumentException("The goal side must" +
  					" be either 'l', 'r' or ' ' ");
  		}
  	}
}
